﻿using System;
using Terraria.ID;

namespace Terraria.ModLoader.Default
{
	// Token: 0x020002FA RID: 762
	public class AprilFools : ModItem
	{
		// Token: 0x170001E0 RID: 480
		// (get) Token: 0x06001D23 RID: 7459 RVA: 0x00014A19 File Offset: 0x00012C19
		public override string Texture
		{
			get
			{
				return "Terraria/Item_3389";
			}
		}

		// Token: 0x06001D24 RID: 7460 RVA: 0x004383E0 File Offset: 0x004365E0
		public static bool CheckAprilFools()
		{
			DateTime now = DateTime.Now;
			return now.Month == 4 && now.Day <= 2;
		}

		// Token: 0x06001D25 RID: 7461 RVA: 0x00014A20 File Offset: 0x00012C20
		public override void SetStaticDefaults()
		{
			base.DisplayName.SetDefault("{$tModLoader.AprilFoolsJoke}");
		}

		// Token: 0x06001D26 RID: 7462 RVA: 0x0043840C File Offset: 0x0043660C
		public override void SetDefaults()
		{
			if (AprilFools.CheckAprilFools())
			{
				base.item.SetNameOverride(Lang.GetItemNameValue(3389) + "...?");
			}
			base.item.useStyle = 4;
			base.item.width = 24;
			base.item.height = 24;
			base.item.UseSound = SoundID.Item2;
			base.item.melee = true;
			base.item.noMelee = true;
			base.item.useAnimation = 25;
			base.item.useTime = 25;
			base.item.damage = 190;
			base.item.knockBack = 6.5f;
			base.item.rare = 10;
		}

		// Token: 0x06001D27 RID: 7463 RVA: 0x00014A32 File Offset: 0x00012C32
		public override bool UseItem(Player player)
		{
			player.AddBuff(103, 216000, true);
			player.AddBuff(119, 216000, true);
			player.AddBuff(120, 216000, true);
			player.AddBuff(137, 216000, true);
			return true;
		}

		// Token: 0x06001D28 RID: 7464 RVA: 0x004384D4 File Offset: 0x004366D4
		public override void AddRecipes()
		{
			if (AprilFools.CheckAprilFools())
			{
				ModRecipe modRecipe = new ModRecipe(base.mod);
				modRecipe.AddIngredient(2, 1);
				modRecipe.SetResult(this, 1);
				modRecipe.AddRecipe();
			}
		}
	}
}
